package com.example.hibernate.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

/**
 * Created by Yasin H on 2018/7/30.
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity(name = "order_item_info")
public class OrderItemInfo extends AbstractEntity {

    @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "order_info_id")
    private OrderInfo orderInfo;

    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "product_id")
    private Product product;
    private Integer count;  //购买数量

}
